package com.wj.spingcloud.controller;

import com.wj.spingcloud.entity.CommonResult;
import com.wj.spingcloud.entity.PaymentEntity;
import com.wj.spingcloud.service.PaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * @description:
 * @author: wj
 * @create: 2021/5/12 11:19
 */
@RestController
@Slf4j
public class OrderFeignController {

    @Resource
    private PaymentService paymentService;

    @GetMapping("/consumer/payment/get/{id}")
    public CommonResult<PaymentEntity> get(@PathVariable("id") Long id){
        CommonResult<PaymentEntity> payment = paymentService.getPaymentById(id);
        return payment;
    }

    @GetMapping("/consumer/payment/timeout")
    public String getPaymentTimeOut(){
        String paymentTimeOut = paymentService.getPaymentTimeOut();
        return paymentTimeOut;
    }
}